package cn.lu.dao;

import cn.lu.pojo.Chapter;
import cn.lu.pojo.Curriculum;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CurriculumMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Curriculum record);

    int insertSelective(Curriculum record);

    Curriculum selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Curriculum record);

    int updateByPrimaryKey(Curriculum record);

    List<Curriculum> selectByIdAndUserId(@Param(value = "curriculumId") Integer curriculumId, @Param(value = "userId") Integer userId);

   int deleteByIdAndUserId(@Param(value = "curriculumId") Integer curriculumId, @Param(value = "userId") Integer userId);


   int updateByIdAndUserId(@Param(value = "curriculum") Curriculum curriculum, @Param(value = "userId") Integer userId);

    /**
     * 判断用户是否是这个课程的老师
     * @param curriculumId
     * @param userId
     * @return
     */
    int curriculumWhetherTeacher(@Param(value = "curriculumId") Integer curriculumId,@Param(value = "userId") Integer userId);

}